﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Class1
    {
        static void Mainx(string[] args)
        {
            byte[] test = new byte[] {0, 0, 0, 0, 0, 0, 0, 0};
            double d = GetDouble(test);
            Console.WriteLine(d);
            Console.ReadLine();

            double testNumber = 8.0;
            byte[] test2 = GetBytes(testNumber);
            Console.Write("Bytes: ");
            for(int i = 0; i < test2.Length; i++)
            {
                Console.Write(test2[i] + " ");
            }
            Console.ReadLine();

            double ada = 18543275075.9258;
            int ada2 = (int) ada;
            Console.WriteLine(ada2);
            Console.ReadLine();
        }

        static double GetDouble(byte[] array)
        {
            double dub = BitConverter.ToDouble(array, 0);
            return dub;
        }

        static byte[] GetBytes(Double number)
        {
            byte[] bytes = BitConverter.GetBytes(number);
            return bytes;
        }
    }
}
